package service

import (
	"context"
	"gin-wheel/app/dao"

	"gorm.io/gorm"
)

type Service struct {
	ctx context.Context
	dao *dao.Dao
}

func NewService(ctx context.Context, db *gorm.DB) Service {
	svc := Service{ctx: ctx}
	if db == nil {
		svc.dao = nil
		return svc
	}
	svc.dao = dao.New(db)
	return svc
}
